﻿using Abp.Application.Services.Dto;
using System;
using System.ComponentModel.DataAnnotations;

namespace ARchGL.Platform.Dtos
{
    /// <summary>
    /// 文件信息 InputModel
    /// </summary>
    public class CreateFileInput : EntityDto<Guid>
    {
        /// <summary>
        /// 主键标识（组织（公司）/项目/人员等等）
        /// </summary>
        public Guid? PrimaryId { get; set; }
        /// <summary>
        /// 《检验批》验收节点标识
        /// </summary>
        public Guid PrimaryId1 { get; set; }
        /// <summary>
        /// 上级分类
        /// </summary>
        public Guid? ParentId { get; set; }
        /// <summary>
        /// 目录/文件 名称
        /// </summary>
        [Required(ErrorMessage = "名称不能为空，请重新输入")]
        public string Name { get; set; }
        /// <summary>
        /// 大小（存储单位为 B）
        /// </summary>
        public int Size { get; set; }
        /// <summary>
        /// 文件Id（来自文件系统）
        /// </summary>
        public Guid? FileId { get; set; }
        /// <summary>
        /// 链接地址
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 扩展名
        /// </summary>
        public string Extension { get; set; }


        /// <summary>
        /// 文件Hash
        /// </summary>
        [MaxLength(50)]
        public string Hash { get; set; }

        /// <summary>
        /// 文件Path
        /// </summary>
        [MaxLength(200)]
        public string Path { get; set; }

        /// <summary>
        /// 文件上传成功后返回数据
        /// </summary>
        [MaxLength(1000)]
        public string FileResponse { get; set; }

        /// <summary>
        /// 文件状态
        /// 0 已上传
        /// 1 正在转换
        /// 2 转换成功
        /// </summary>
        private EnumFileStatus FileState { get => EnumFileStatus.转换成功; }

        /// <summary>
        /// 文件夹类型
        /// </summary>
        public EnumDocumentPType PType { get; set; }

        /// <summary>
        /// 是否系统级
        /// </summary>
        public bool IsSystem { get; set; }

        /// <summary>
        /// 透传字段
        /// </summary>
        public string TransInfo { get; set; }

        /// <summary>
        /// 模板标识
        /// </summary>
        public Guid TemplateId { get; set; }
    }
}
